﻿<?xml version="1.0" encoding="utf-8" ?>
<DbDataRequest connection="$UserLoginDBConnection$" type="$UserLoginDbType$" defaultFormatter="bizobj CompanyTreeNode">
  <SqlStatement hasResults="true">
	  SELECT t.parentHostId, t.id, t.parentId,tc.keyName,c.enable
	  FROM ObjectTreeNodes  t 
	  	INNER JOIN ObjectTreeCounts as tc on tc.objectId = t.objectId
		INNER JOIN Companies c ON c.id = t.parentHostId
	  WHERE (t.id=@parentId OR t.parentHostId =@id) AND c.enable=0
	  ORDER BY tc.keyName
  </SqlStatement>
  <Param name="parentId" type="UniqueIdentifier"/>
  <Param name="id" type ="UniqueIdentifier" />
</DbDataRequest>